// Proxy对象

const person = {
    name: 'zec',
    age: 20
}

const personProxy = new Proxy(person, {
    get(target, property) {
        return property in target ? target[property] : 'default';
        // console.log(target, property)
        // return 100
    },
    set(target, property, value) {
        // console.log(target, property, value);
        // if (!Number.isInteger(value)) {
        //     throw new TypeError()
        // }
        target[property] = value;
    }
})

console.log(Reflect.has(person, 'name'))

// personProxy.gender = true;
// console.log(personProxy.name)